#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream> 
using namespace std;

const long long MOD = 1e9 +7;

long long sequence(int n)
{
	if (n == 1)
	{
		return 1;
	}
	else
	{
		if (n % 2 == 1)
		{
			return 2 * sequence(n - 1) % MOD;
		}
		else {
			return ((1 + sequence(n - 1)) % MOD);
		}
	}
}

int main()
{
	int n;
	cin >> n;
	cout << sequence(n) << endl;
	return 0;
}